**** PROGRAM FILE FOR "INFORMAL VERSUS FORMAL BARGAINING STRUCTURES" PROJECT: REPORTED MODELS' RESULTS ****
 
 
* OPEN STATA OUTPUT FILE LOG *

   log using "C:\Users\gk57526\Dropbox\Informal & Formal Bargaining (BAA Reforms)\JOP Replication File Materials\Output\execbudinfluence.08-26-2020.SECTION 4.CONTROL FUNCTION FOR ENDOGENOUS REGRESSOR MODELS.comments.smcl" 




 * OPEN "EXECUTIVE BUDGETARY INFLUENCE" DATABASE WITH NEWLY CREATED VARIABLES
 
use "C:\Users\gk57526\Dropbox\Informal & Formal Bargaining (BAA Reforms)\JOP Replication File Materials\Data\execbudinfluence.08-26-2020.REPORTED MODELS.REV.comments.dta", replace

 

*** DECLARE DATABASE AS A PANEL (AGENCY ID * FISCAL YEAR): 

xtset agenid fyear, yearly

*
*
*

*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



** POSIT THAT E <= A: REGIMEREG, REGIMETOT = 1 (I.E., FAVORABLE EXECUTIVE BARGAINING POSITION) IS MORE PREVALENT IN POST-BAA ERA COMPARED TO PRE-BAA ERA **
** POSIT THAT E > A : REGIMEREG, REGIMETOT = 0 (I.E., UNFAVORABLE EXECUTIVE BARGAINING POSITION) IS LESS PREVALENT IN POST-BAA ERA COMPARED TO PRE-BAA ERA **





******* PROPOSITION 1: NOT RELEVANT TO ENDOGENEITY BIAS EVALUATION ************



*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



******* PROPOSITION 2: DOES A STRONGER EXECUTIVE VETO THREAT [VIA BAA REFORMS] TRANSLATE INTO GREATER EXECUTIVE BUDGETARY INFLUENCE UNDER A WEAK VETO THREAT? ************


** POSIT THAT EXECUTIVE BUDGETARY INFLUENCE HAS DECLINED [IMPROVED] IN POST-BAA ERA COMPARED TO PRE-BAA ERA FOR RELATIVELY AUSTERE (PROFLIGATE) EXECUTIVE BUDGET PROPOSALS [E <= A] ([E > A]) **




*** CREATE LAGGED ENDOGENOUS REGRESSOR INSTRUMENTS ***

quietly movestay congbudchangereg2  l1congbudchangereg2 execbudchangereg2 ebcreg2baa bureauofbudget ///
lnagencyage unifiedpartygovt  presadminyear if agenid!=15, cluster(agenid) /// 
select(regimereg = executiveagency) difficult
*
*
*
gen l1execbudchangereg2 = l1.execbudchangereg2
*
gen l1execbudchangetot2 = l1.execbudchangetot2
*
*
*
sum execbudchangereg2 if e(sample), detail
gen execbudchangereg2meandevsq = (execbudchangereg2 - 4.23261)^2
gen execbudchangereg2meandevcubic = (execbudchangereg2 - 4.23261)^3
*
sum execbudchangetot2 if e(sample), detail
gen execbudchangetot2meandevcubic = (execbudchangetot2 - 5.219665)^3
*
*


*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** BASELINE MODEL SPECIFICATION, I -- REGULAR DISCRETIONARY BUDGET [EXCLUDES EXTRAMURAL FUNDS]: ENDOGENOUS REGIME SWITCHING REGRESSION MODELS ESTIMATED BY FIML ///




*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*** STEP 1A: ESTIMATE FIRST-STAGE ENDOGENOUS REGRESSOR REGRESSIONS WITH ALTERNATIVE INSTRUMENTS [CONGCONNECT (SEE VARIABLE LABEL FOR DEFINITION); ///
***          LAGGED ENDOGENOUS REGRESSOR (E.G., ARELLANO AND BOND 1991); & HIGHER MOMENTS {2ND & 3RD ORDER} OF ENDOGENOUS REGRESSOR (SEE LEWBEL 1997)]  **** 
***          NOTE: ONLY ESTIMATING "EXECBUDCHANGEREG2" -- LATER WILL CREATE INTERACTIONS WITH OTHER NON-ENDOGENOUS COVARIATES TO BE ESTIMATED IN THE OUTCOME EQUATION ***


*** STEP 1B: COMPUTE F-STATISTIC FOR INSTRUMENT  = 0 (F ~ > 10: STRONG INSTRUMENT; F << 10: WEAK INSTRUMENT) ***
         
		 
*** STEP 1C: COMPUTE RESIDUALS FROM FIRST-STAGE REGRESSION & STORE AS A NEW VARIABLE	


*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*** STEP 1A-C.i: LAGGED ENDOGENOUS REGRESSOR INSTRUMENT  ***

regress execbudchangereg2  l1execbudchangereg2  l1congbudchangereg2   bureauofbudget ///
lnagencyage unifiedpartygovt presadminyear if agenid!=15, cluster(agenid)
*

** TABLE SI-4A: PROPOSITION 2 [REGULAR DISCRETIONARY BUDGET MODEL: LAGGED EXECUTIVE BUDGET PROPOSAL GROWTH]

test  l1execbudchangereg2 = 0


*** STEP 1A-C.ii: HIGHER MOMENTS INSTRUMENTS [2nd & 3rd ORDER] ***

regress execbudchangereg2  execbudchangereg2meandevsq  execbudchangereg2meandevcubic  l1congbudchangereg2   bureauofbudget ///
lnagencyage  unifiedpartygovt presadminyear if agenid!=15, cluster(agenid)
*

** TABLE SI-4A: PROPOSITION 2 [REGULAR DISCRETIONARY BUDGET MODEL: 2ND & 3RD MOMENTS]

test  execbudchangereg2meandevsq = execbudchangereg2meandevcubic = 0

predict hmiresidp2reg2, residuals



*** STEP 2: CREATE APPROPRIATE INTERACTIONS BETWEEN FIRST-STAGE ENDOGENOUS REGRESSOR RESIDUAL COVARIATE AND BAA BINARY INDICATOR *** 

gen hmiresidp2reg2baa = hmiresidp2reg2*bureauofbudget




*** STEP 3A: ESTIMATE THE OUTCOME MODEL OF INTEREST AS A CONTROL FUNCTION WITH FIRST-STAGE REGRESSION RESIDUALS ///
***         INCLUDED AS A COVARIATE TO ACCOUNT FOR ENDOGENEITY BIAS BETWEEN EXECBUDCHANGEREG2 & CONGBUDCHANGEREG2


*** STEP 3B: COMPUTE LIKELIHOOD TEST RESTRICTION FOR RESIDUAL COVARIATES (CONTROLLING FOR ENDOGENEITY BIAS) APPEARING IN THE MODEL = 0 ***


*** STEP 3C: COMPUTE POST-ESTIMATION MARGINAL EFFETS USING LINCOM ***

 
*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** STEP 3A-C.iii: HIGHER-ORDER MOEMENTS OF ENDOGENOUS REGRESSOR INSTRUMENT [2ND & 3RD ORDER] ***

 
*** BASELINE MODEL SPECIFICATION, I.iii -- REGULAR DISCRETIONARY BUDGET [EXCLUDES EXTRAMURAL FUNDS]: ENDOGENOUS REGIME SWITCHING REGRESSION MODELS ESTIMATED BY FIML ///
*** [SELECTIVITY COVARIATE: AGENCY DESIGN (EXECUTIVE DEPARTMENT / INDEPENDENT AGENCY BINARY DISTINCTION)] ***

movestay congbudchangereg2  l1congbudchangereg2 execbudchangereg2 ebcreg2baa bureauofbudget ///
lnagencyage unifiedpartygovt  presadminyear hmiresidp2reg2 hmiresidp2reg2baa if agenid!=15, cluster(agenid) /// 
select(regimereg = executiveagency) difficult
*
estat ic
*
*
test [congbudchangereg2_1]hmiresidp2reg2 = [congbudchangereg2_1]hmiresidp2reg2baa = 0
test [congbudchangereg2_0]hmiresidp2reg2 = [congbudchangereg2_0]hmiresidp2reg2baa = 0
test [congbudchangereg2_1]hmiresidp2reg2 = [congbudchangereg2_1]hmiresidp2reg2baa = [congbudchangereg2_0]hmiresidp2reg2 = [congbudchangereg2_0]hmiresidp2reg2baa = 0
*
*
*


**** TABLE SI-4B: CONTROL FUNCTION MODEL ESTIMATES [PROPOSITION 2] ****

* BETA_12 [REGULAR DISCRETIONARY BUDGET MODEL]: REGIME 1: E <= A
lincom [congbudchangereg2_1]ebcreg2baa  
*
*
* BETA_22 [REGULAR DISCRETIONARY BUDGET MODEL]: REGIME 0: E > A
lincom [congbudchangereg2_0]ebcreg2baa  
*
*
*
* BETA_22 - BETA_12 [[REGULAR DISCRETIONARY BUDGET MODEL]: REGIME 1 VS. REGIME 0
lincom [congbudchangereg2_1]ebcreg2baa - [congbudchangereg2_0]ebcreg2baa 



*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** BASELINE MODEL SPECIFICATION, II -- TOTAL DISCRETIONARY BUDGET [INCLUDES EXTRAMURAL FUNDS]: ENDOGENOUS REGIME SWITCHING REGRESSION MODELS ESTIMATED BY FIML ///
*** [SELECTIVITY COVARIATE: AGENCY DESIGN (EXECUTIVE DEPARTMENT / INDEPENDENT AGENCY BINARY DISTINCTION)] ***



*** STEP 1A: ESTIMATE FIRST-STAGE ENDOGENOUS REGRESSOR REGRESSIONS WITH ALTERNATIVE INSTRUMENTS [CONGCONNECT (SEE VARIABLE LABEL FOR DEFINITION); ///
***          LAGGED ENDOGENOUS REGRESSOR (E.G., ARELLANO AND BOND 1991); & HIGHER MOMENTS {2ND & 3RD ORDER} OF ENDOGENOUS REGRESSOR (SEE LEWBEL 1997)]  **** 
***          NOTE: ONLY ESTIMATING "EXECBUDCHANGEREG2" -- LATER WILL CREATE INTERACTIONS WITH OTHER NON-ENDOGENOUS COVARIATES TO BE ESTIMATED IN THE OUTCOME EQUATION ***


*** STEP 1B: COMPUTE F-STATISTIC FOR INSTRUMENT  = 0 (F ~ > 10: STRONG INSTRUMENT; F << 10: WEAK INSTRUMENT) ***
         
		 
*** STEP 1C: COMPUTE RESIDUALS FROM FIRST-STAGE REGRESSION & STORE AS A NEW VARIABLE	







*** STEP 1A-C.i: LAGGED ENDOGENOUS REGRESSOR INSTRUMENT  ***

regress execbudchangetot2  l1execbudchangetot2 l1congbudchangetot2   bureauofbudget ///
lnagencyage unifiedpartygovt presadminyear if agenid!=15, cluster(agenid) 
*

** TABLE SI-4A: PROPOSITION 2 [TOTAL DISCRETIONARY BUDGET MODEL: LAGGED EXECUTIVE BUDGET PROPOSAL GROWTH]

test  l1execbudchangetot2 = 0
		 
		 
		 
*** STEP 1A-C.ii: HIGHER MOMENTS INSTRUMENT [3rd ORDER] ***

regress execbudchangetot2   execbudchangetot2meandevcubic  l1congbudchangetot2   bureauofbudget ///
lnagencyage unifiedpartygovt presadminyear if agenid!=15, cluster(agenid) 
*

** TABLE SI-4A: PROPOSITION 2 [TOTAL DISCRETIONARY BUDGET MODEL: 3RD MOMENT]

test  execbudchangetot2meandevcubic = 0

predict hmiresidp2tot2, residuals




*** STEP 2: CREATE APPROPRIATE INTERACTIONS BETWEEN FIRST-STAGE ENDOGENOUS REGRESSOR RESIDUAL COVARIATE AND BAA BINARY INDICATOR *** 

*
gen hmiresidp2tot2baa = hmiresidp2tot2*bureauofbudget




*** STEP 3A: ESTIMATE THE OUTCOME MODEL OF INTEREST AS A CONTROL FUNCTION WITH FIRST-STAGE REGRESSION RESIDUALS ///
***         INCLUDED AS A COVARIATE TO ACCOUNT FOR ENDOGENEITY BIAS BETWEEN EXECBUDCHANGEREG & CONGBUDCHANGEREG


*** STEP 3B: COMPUTE LIKELIHOOD TEST RESTRICTION FOR RESIDUAL COVARIATES (CONTROLLING FOR ENDOGENEITY BIAS) APPEARING IN THE MODEL = 0 ***


*** STEP 3C: COMPUTE POST-ESTIMATION MARGINAL EFFETS USING LINCOM ***


*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** STEP 3A-C.iii: HIGHER-ORDER MOEMENTS OF ENDOGENOUS REGRESSOR INSTRUMENT [2ND & 3RD ORDER] ***

 
*** BASELINE MODEL SPECIFICATION, II.iii -- TOTAL DISCRETIONARY BUDGET [EXCLUDES EXTRAMURAL FUNDS]: ENDOGENOUS REGIME SWITCHING REGRESSION MODELS ESTIMATED BY FIML ///
*** [SELECTIVITY COVARIATE: AGENCY DESIGN (EXECUTIVE DEPARTMENT / INDEPENDENT AGENCY BINARY DISTINCTION)] ***

movestay congbudchangetot2  l1congbudchangetot2 execbudchangetot2 ebctot2baa bureauofbudget ///
lnagencyage unifiedpartygovt hmiresidp2tot2 hmiresidp2tot2baa if agenid!=15, cluster(agenid) ///
select(regimetot = executiveagency) difficult
*
estat ic
*
*
*
test [congbudchangetot2_1]hmiresidp2tot2 = [congbudchangetot2_1]hmiresidp2tot2baa = 0
test [congbudchangetot2_0]hmiresidp2tot2 = [congbudchangetot2_0]hmiresidp2tot2baa = 0
test [congbudchangetot2_1]hmiresidp2tot2 = [congbudchangetot2_1]hmiresidp2tot2baa = [congbudchangetot2_0]hmiresidp2tot2 = [congbudchangetot2_0]hmiresidp2tot2baa = 0
*
*
*

**** TABLE SI-4B: CONTROL FUNCTION MODEL ESTIMATES [PROPOSITION 2] ****

* BETA_12 [TOTAL DISCRETIONARY BUDGET MODEL]: REGIME 1: E <= A
lincom [congbudchangetot2_1]ebctot2baa  
*
*
* BETA_22 [TOTAL DISCRETIONARY BUDGET MODEL]: REGIME 0: E > A
lincom [congbudchangetot2_0]ebctot2baa  
*
*
*
* BETA_22 - BETA_12 [TOTAL DISCRETIONARY BUDGET MODEL]: REGIME 1 VS. REGIME 0
lincom [congbudchangetot2_1]ebctot2baa - [congbudchangetot2_0]ebctot2baa 



*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

  
  
 
 
 
 ******* PROPOSITION 3: DOES CENTRALIZATION [VIA BAA REFORMS] REDUCE THE BUDGETARY INFLUENCE OF AGENCY HEADS? **********
 



*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** AUGMENTED TENURE DIFFERENTIAL MODEL SPECIFICATION, I  -- REGULAR DISCRETIONARY BUDGET [EXCLUDES EXTRAMURAL FUNDS]: ///
*** ENDOGENOUS REGIME SWITCHING REGRESSION MODELS ESTIMATED BY FIML ///
*** [SELECTIVITY COVARIATE: AGENCY DESIGN (EXECUTIVE DEPARTMENT / INDEPENDENT AGENCY BINARY DISTINCTION)] ***
*** LN [AGENCY HEAD TENURE [AHT]] *** FULL SAMPLE OF AHT OBSERVATIONS ***
*** LINEAR INTERACTION EFFECT IN AGENCY HEAD COVARIATE: CONTINUOUS AGENCY HEAD COVARIATE ***



*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*** STEP 1A: ESTIMATE FIRST-STAGE ENDOGENOUS REGRESSOR REGRESSIONS WITH ALTERNATIVE INSTRUMENTS [CONGCONNECT (SEE VARIABLE LABEL FOR DEFINITION); ///
***          LAGGED ENDOGENOUS REGRESSOR (E.G., ARELLANO AND BOND 1991); & HIGHER MOMENTS {2ND & 3RD ORDER} OF ENDOGENOUS REGRESSOR (SEE LEWBEL 1997)]  **** 
***          NOTE: ONLY ESTIMATING "EXECBUDCHANGEREG2" -- LATER WILL CREATE INTERACTIONS WITH OTHER NON-ENDOGENOUS COVARIATES TO BE ESTIMATED IN THE OUTCOME EQUATION ***


*** STEP 1B: COMPUTE F-STATISTIC FOR INSTRUMENT  = 0 (F ~ > 10: STRONG INSTRUMENT; F << 10: WEAK INSTRUMENT) ***
         
		 
*** STEP 1C: COMPUTE RESIDUALS FROM FIRST-STAGE REGRESSION & STORE AS A NEW VARIABLE	


*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*** STEP 1A-C.i: LAGGED ENDOGENOUS REGRESSOR INSTRUMENT  ***

regress execbudchangereg2  l1execbudchangereg2  l1congbudchangereg2   bureauofbudget lnagencyheadtenure ///
lnagencyage  unifiedpartygovt presadminyear if agenid!=15, cluster(agenid) 
*
** TABLE SI-4A: PROPOSITION 3 [REGULAR DISCRETIONARY BUDGET MODEL: LAGGED EXECUTIVE BUDGET PROPOSAL GROWTH]

test  l1execbudchangereg2 = 0


*** STEP 1A-C.ii: HIGHER MOMENTS INSTRUMENTS [2nd & 3rd ORDER] ***

regress execbudchangereg2  execbudchangereg2meandevsq  execbudchangereg2meandevcubic  l1congbudchangereg2   bureauofbudget lnagencyheadtenure ///
lnagencyage  unifiedpartygovt presadminyear if agenid!=15, cluster(agenid)
*

** TABLE SI-4A: PROPOSITION 3 [REGULAR DISCRETIONARY BUDGET MODEL: 2ND & 3RD MOMENTS]

test  execbudchangereg2meandevsq = execbudchangereg2meandevcubic = 0
*
predict hmiresidp3reg2, residuals



*** STEP 2: CREATE APPROPRIATE INTERACTIONS BETWEEN FIRST-STAGE ENDOGENOUS REGRESSOR RESIDUAL COVARIATE AND BAA BINARY INDICATOR *** 
*
gen hmiresidp3reg2baa = hmiresidp3reg2*bureauofbudget
*
gen hmiresidp3reg2lnaht = hmiresidp3reg2*lnagencyheadtenure
*
gen hmiresidp3reg2baalnaht = hmiresidp3reg2*lnagencyheadtenure*bureauofbudget





*** STEP 3A: ESTIMATE THE OUTCOME MODEL OF INTEREST AS A CONTROL FUNCTION WITH FIRST-STAGE REGRESSION RESIDUALS ///
***         INCLUDED AS A COVARIATE TO ACCOUNT FOR ENDOGENEITY BIAS BETWEEN EXECBUDCHANGEREG2 & CONGBUDCHANGEREG2


*** STEP 3B: COMPUTE LIKELIHOOD TEST RESTRICTION FOR RESIDUAL COVARIATES (CONTROLLING FOR ENDOGENEITY BIAS) APPEARING IN THE MODEL = 0 ***


*** STEP 3C: COMPUTE POST-ESTIMATION MARGINAL EFFETS USING LINCOM ***

  

*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** STEP 3A-C.iii: HIGHER-ORDER MOEMENTS OF ENDOGENOUS REGRESSOR INSTRUMENT [2ND & 3RD ORDER] ***


movestay (congbudchangereg2 l1congbudchangereg2  execbudchangereg2 bureauofbudget ebcreg2baa lnagencyheadtenure  baalnaht  ebcreg2lnaht  ebcreg2baalnaht  ///
lnagencyage unifiedpartygovt presadminyear hmiresidp3reg2 hmiresidp3reg2baa hmiresidp3reg2lnaht hmiresidp3reg2baalnaht) ///
if agenid!=15 , cluster(agenid) select(regimereg = executiveagency) difficult
*
estat ic
*
*
test [congbudchangereg2_1]hmiresidp3reg2 = [congbudchangereg2_1]hmiresidp3reg2baa = [congbudchangereg2_1]hmiresidp3reg2lnaht = [congbudchangereg2_1]hmiresidp3reg2baalnaht = 0
test [congbudchangereg2_0]hmiresidp3reg2 = [congbudchangereg2_0]hmiresidp3reg2baa = [congbudchangereg2_0]hmiresidp3reg2lnaht = [congbudchangereg2_0]hmiresidp3reg2baalnaht = 0
test [congbudchangereg2_1]hmiresidp3reg2 = [congbudchangereg2_1]hmiresidp3reg2baa = [congbudchangereg2_1]hmiresidp3reg2lnaht = [congbudchangereg2_1]hmiresidp3reg2baalnaht = ///
[congbudchangereg2_0]hmiresidp3reg2 = [congbudchangereg2_0]hmiresidp3reg2baa = [congbudchangereg2_0]hmiresidp3reg2lnaht = [congbudchangereg2_0]hmiresidp3reg2baalnaht = 0




**** TABLE SI-4B: CONTROL FUNCTION MODEL ESTIMATES [PROPOSITION 3] ****


** BETA_13 [REGULAR DISCRETIONARY BUDGET MODEL]: REGIME 1: E <= A **

lincom [congbudchangereg2_1]ebcreg2lnaht 
*

** BETA_23 [REGULAR DISCRETIONARY BUDGET MODEL]: REGIME 0: E > A **
lincom [congbudchangereg2_0]ebcreg2lnaht 
*

** BETA_14 [REGULAR DISCRETIONARY BUDGET MODEL]: REGIME 1: E <= A **
lincom  [congbudchangereg2_1]ebcreg2baalnaht
*

** BETA_24 [REGULAR DISCRETIONARY BUDGET MODEL]: REGIME 0: E > A **
lincom  [congbudchangereg2_0]ebcreg2baalnaht 



*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** AUGMENTED TENURE DIFFERENTIAL MODEL SPECIFICATION, II  -- TOTAL DISCRETIONARY BUDGET [INCLUDING EXTRAMURAL FUNDS]: ///
*** ENDOGENOUS REGIME SWITCHING REGRESSION MODELS ESTIMATED BY FIML ///
*** [SELECTIVITY COVARIATE: AGENCY DESIGN (EXECUTIVE DEPARTMENT / INDEPENDENT AGENCY BINARY DISTINCTION)] ***
*** LN [AGENCY HEAD TENURE [AHT]] *** FULL SAMPLE OF AHT OBSERVATIONS ***
*** LINEAR INTERACTION EFFECT IN AGENCY HEAD COVARIATE: CONTINUOUS AGENCY HEAD COVARIATE ***





*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*** STEP 1A: ESTIMATE FIRST-STAGE ENDOGENOUS REGRESSOR REGRESSIONS WITH ALTERNATIVE INSTRUMENTS [CONGCONNECT (SEE VARIABLE LABEL FOR DEFINITION); ///
***          LAGGED ENDOGENOUS REGRESSOR (E.G., ARELLANO AND BOND 1991); & HIGHER MOMENTS {2ND & 3RD ORDER} OF ENDOGENOUS REGRESSOR (SEE LEWBEL 1997)]  **** 
***          NOTE: ONLY ESTIMATING "EXECBUDCHANGEREG2" -- LATER WILL CREATE INTERACTIONS WITH OTHER NON-ENDOGENOUS COVARIATES TO BE ESTIMATED IN THE OUTCOME EQUATION ***


*** STEP 1B: COMPUTE F-STATISTIC FOR INSTRUMENT  = 0 (F ~ > 10: STRONG INSTRUMENT; F << 10: WEAK INSTRUMENT) ***
         
		 
*** STEP 1C: COMPUTE RESIDUALS FROM FIRST-STAGE REGRESSION & STORE AS A NEW VARIABLE	


***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


*** STEP 1A-C.i: LAGGED ENDOGENOUS REGRESSOR INSTRUMENT  ***

regress execbudchangetot2  l1execbudchangetot2  l1congbudchangetot2   bureauofbudget lnagencyheadtenure ///
lnagencyage  unifiedpartygovt presadminyear if agenid!=15, cluster(agenid)
*
** TABLE SI-4A: PROPOSITION 3 [TOTAL DISCRETIONARY BUDGET MODEL: LAGGED EXECUTIVE BUDGET PROPOSAL GROWTH]
test  l1execbudchangetot2 = 0


*** STEP 1A-C.ii: HIGHER MOMENTS INSTRUMENTS [3rd ORDER] ***

regress execbudchangetot2   execbudchangetot2meandevcubic  l1congbudchangetot2   bureauofbudget lnagencyheadtenure ///
lnagencyage  unifiedpartygovt presadminyear if agenid!=15, cluster(agenid)
*
** TABLE SI-4A: PROPOSITION 3 [TOTAL DISCRETIONARY BUDGET MODEL: 3RD MOMENT]

test  execbudchangetot2meandevcubic = 0

predict hmiresidp3tot2, residuals




*** STEP 2: CREATE APPROPRIATE INTERACTIONS BETWEEN FIRST-STAGE ENDOGENOUS REGRESSOR RESIDUAL COVARIATE AND BAA BINARY INDICATOR *** 
*
gen hmiresidp3tot2baa = hmiresidp3tot2*bureauofbudget
*
gen hmiresidp3tot2lnaht = hmiresidp3tot2*lnagencyheadtenure
*
gen hmiresidp3tot2baalnaht = hmiresidp3tot2*lnagencyheadtenure*bureauofbudget





*** STEP 3A: ESTIMATE THE OUTCOME MODEL OF INTEREST AS A CONTROL FUNCTION WITH FIRST-STAGE REGRESSION RESIDUALS ///
***         INCLUDED AS A COVARIATE TO ACCOUNT FOR ENDOGENEITY BIAS BETWEEN EXECBUDCHANGEREG2 & CONGBUDCHANGEREG2


*** STEP 3B: COMPUTE LIKELIHOOD TEST RESTRICTION FOR RESIDUAL COVARIATES (CONTROLLING FOR ENDOGENEITY BIAS) APPEARING IN THE MODEL = 0 ***


*** STEP 3C: COMPUTE POST-ESTIMATION MARGINAL EFFETS USING LINCOM ***

 
 
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*** STEP 3A-C.iii: HIGHER-ORDER MOEMENTS OF ENDOGENOUS REGRESSOR INSTRUMENT [2ND & 3RD ORDER] ***


movestay (congbudchangetot2 l1congbudchangetot2  execbudchangetot2 bureauofbudget ebctot2baa lnagencyheadtenure baalnaht  ebctot2lnaht  ebctot2baalnaht  ///
lnagencyage  unifiedpartygovt presadminyear hmiresidp3tot2 hmiresidp3tot2baa hmiresidp3tot2lnaht hmiresidp3tot2baalnaht) ///
if agenid!=15 , cluster(agenid) select(regimetot = executiveagency) difficult
*
estat ic
*
*
test [congbudchangetot2_1]hmiresidp3tot2 = [congbudchangetot2_1]hmiresidp3tot2baa = [congbudchangetot2_1]hmiresidp3tot2lnaht = [congbudchangetot2_1]hmiresidp3tot2baalnaht = 0
test [congbudchangetot2_0]hmiresidp3tot2 = [congbudchangetot2_0]hmiresidp3tot2baa = [congbudchangetot2_0]hmiresidp3tot2lnaht = [congbudchangetot2_0]hmiresidp3tot2baalnaht = 0
test [congbudchangetot2_1]hmiresidp3tot2 = [congbudchangetot2_1]hmiresidp3tot2baa = [congbudchangetot2_1]hmiresidp3tot2lnaht = [congbudchangetot2_1]hmiresidp3tot2baalnaht = ///
[congbudchangetot2_0]hmiresidp3tot2 = [congbudchangetot2_0]hmiresidp3tot2baa = [congbudchangetot2_0]hmiresidp3tot2lnaht = [congbudchangetot2_0]hmiresidp3tot2baalnaht = 0





**** TABLE SI-4B: CONTROL FUNCTION MODEL ESTIMATES [PROPOSITION 3] ****


** BETA_13 [TOTAL DISCRETIONARY BUDGET MODEL]: REGIME 1: E <= A **

lincom [congbudchangetot2_1]ebctot2lnaht 
*

** BETA_23 [TOTAL DISCRETIONARY BUDGET MODEL]: REGIME 0: E > A **
lincom [congbudchangetot2_0]ebctot2lnaht 
*

** BETA_14 [TOTAL DISCRETIONARY BUDGET MODEL]: REGIME 1: E <= A **
lincom  [congbudchangetot2_1]ebctot2baalnaht
*

** BETA_24 [TOTAL DISCRETIONARY BUDGET MODEL]: REGIME 0: E > A **
lincom  [congbudchangetot2_0]ebctot2baalnaht 



*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************






 * SAVE "EXECUTIVE BUDGETARY INFLUENCE" DATABASE AFTER ANALYSES OF REPORTED MODELS *
 
save "C:\Users\gk57526\Dropbox\Informal & Formal Bargaining (BAA Reforms)\JOP Replication File Materials\Data\execbudinfluence.08-26-2020.REPORTED MODELS.CONTROL FUNCTION FOR ENDOGENOUS REGRESSOR MODELS.comments.dta", replace



 * CLOSE LOG FILE

 log close
 